
import logApi from '@/api/declaration/logApi'
import httpRequest from '@/config/axios/httpRequest'
import {
  ExportLogReq,
  ExportOperateLogReq,
  OperateLogByPageReq,
  OperateLogByPageResp,
  QueryLogPageReq,
  QueryLogPageResp
} from '@/models/system/LogModel'

// 查询登录日志列表
export const getLoginLogPage = async (params: QueryLogPageReq) => {
  return await httpRequest.get<QueryLogPageResp>(logApi.QueryLogPage, { params })
}

// 导出登录日志
export const exportLoginLog = async (params: ExportLogReq) => {
  return await httpRequest.download(logApi.DownloadLog, { params, responseType: 'blob' })
}

// 查询操作日志列表
export const getOperateLogPage = async (params: OperateLogByPageReq) => {
  return await httpRequest.get<OperateLogByPageResp>(logApi.QueryOperateLogPage, { params })
}
// 导出操作日志
export const exportOperateLog = async (params: ExportOperateLogReq) => {
  return await httpRequest.download(logApi.QueryOperateLogPage, { params, responseType: 'blob' })
}
